package tags_api

import (
	"gin_study_blog/common/http"
	"gin_study_blog/models"
	"gin_study_blog/service/helper"

	"github.com/gin-gonic/gin"
)

// TagsListView 标签列表
func (TagsApi) TagsListView(c *gin.Context) {
	var li models.PageInfo
	if err := c.ShouldBindQuery(&li); err != nil {
		http.FailWithCode(http.ParamsError, c)
		return
	}

	list, count, _ := helper.CommonList(models.TagModel{}, helper.Option{
		PageInfo: li,
		Debug:    true,
	})
	// 还需要显示标签下面有多少个文章数量
	http.IsOkWithList(list, count, c)
}
